package com.yc.service;

import com.yc.entity.Notice;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yc.mapper.NoticeMapper;
import com.yc.vo.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service
public class NoticeService extends ServiceImpl<NoticeMapper, Notice> {

    @Resource
    private NoticeMapper noticeMapper;

    /**
     * 查询公告的通知
     * @return
     */
    public Result querynotice(){
        List<Map<String, Object>> maps = noticeMapper.queryNotice();
        return Result.success(maps);
    }

    /**
     * 领导查询5条数据
     * @return
     */
    public Result querynoticeByManage(){
        List<Map<String, Object>> maps = noticeMapper.queryNoticeByManage();
        return Result.success(maps);
    }
}
